/* Copyright (c) 2016-2020 Enfry Ltd. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of Enfry. 
 * You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Enfry.
 */
package com.enfry.storage;

import com.alibaba.fastjson.JSONObject;
import com.enfry.storage.exception.ExCode;

public class Response {
    
    private String code;
    private String msg;
    private Object data;

    public Response() {
        
    }
    
    public Response(String code) {
        this.code = code;
    }
    
    public Response(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    
    public Response(String code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    
    public Response(ExCode exCode) {
        this.code = exCode.getCode();
        this.msg = exCode.getMsg();
    }
    
    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

}
